package cn.memorynine.consumer.controller;

import cn.memorynine.consumer.model.activity.manage.ActivityInfoParam;
import cn.memorynine.consumer.model.activity.manage.ActivityListParam;
import cn.memorynine.consumer.model.activity.manage.CancelActivityParam;
import cn.memorynine.consumer.model.activity.manage.SaveActivityParam;
import cn.memorynine.dao.entity.ForumPost;
import lombok.extern.slf4j.Slf4j;
import cn.memorynine.common.model.ResponseWrapper;
import cn.memorynine.consumer.service.ActivityManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;

/**
* 管理后台-活动管理控制器
* @author 代码生成器
*/
@Slf4j
@RestController
@RequestMapping("/admin/ActivityManage")
public class ActivityManageController {

    @Autowired
    private ActivityManageService ActivityManageService;

    /**
     * 1.获取所有活动列表
     * @return
     */
    @RequestMapping("/activityList")
    public ResponseWrapper activityList(@RequestBody @Validated ActivityListParam param){
        return ActivityManageService.activityList(param);
    }

    /**
     * 2.新增/修改 活动信息
     * @return
     */
    @RequestMapping("/saveActivity")
    public ResponseWrapper saveActivity(@RequestBody @Validated SaveActivityParam param){
        return ActivityManageService.saveActivity(param);
    }

    /**
     * 3.新增/修改 获取活动信息
     * @return
     */
    @RequestMapping("/activityInfo")
    public ResponseWrapper activityInfo(@RequestBody @Validated ActivityInfoParam param){
        return ActivityManageService.activityInfo(param);
    }

    /**
     * 4.取消活动
     */
    @RequestMapping("/cancelActivity")
    public ResponseWrapper cancelActivity(@RequestBody @Validated CancelActivityParam param){
        return ActivityManageService.cancelActivity(param);
    }


}